package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.maintenancesystem.basisinfo;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.maintenancesystem.basisinfo.FireControlComponentsService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @Author: YangYu
 * @ClassName: FireControlComponentsController
 * @Date: Created in 10:11 2020/12/25
 * @Description: 消防部件
 */
@Action
@RequestMapping(value = "basisinfo/fireControlComponents")
public class FireControlComponentsController extends BaseController {


    @Resource
    private FireControlComponentsService fireControlComponentsService;


    /**
     * @Author YangYu
     * @Description 消防部件分页列表
     * @Date Created in 10:41 2020/12/25
     * @Param [jsonParam]
     */

    @At(value = "fireControlComponentsPagList", method = RequestMethod.GET, param = {"page", "limit"})
    public RespEntity fireControlComponentsPagList(@RequestBody(required = false) JSONObject jsonParam) {
        return fireControlComponentsService.fireControlComponentsPagList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 消防部件新增
     * @Date Created in 10:49 2020/12/28
     * @Param [jsonParam]
     */

    @At(value = "add", method = RequestMethod.POST)
    public RespEntity add(@RequestBody(required = false) JSONObject jsonParam) {
        return fireControlComponentsService.add(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 消防部件更新
     * @Date Created in 10:50 2020/12/28
     * @Param [jsonParam]
     */

    @At(value = "update", method = RequestMethod.POST)
    public RespEntity update(@RequestBody(required = false) JSONObject jsonParam) {
        return fireControlComponentsService.update(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 消防部件详情
     * @Date Created in 10:51 2020/12/28
     * @Param [jsonParam]
     */

    @At(value = "detail", method = RequestMethod.GET)
    public RespEntity detail(@RequestBody(required = false) JSONObject jsonParam) {
        return fireControlComponentsService.detail(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 消防部件删除
     * @Date Created in 10:52 2020/12/28
     * @Param [jsonParam]
     */

    @At(value = "delete", method = RequestMethod.POST)
    public RespEntity delete(@RequestBody(required = false) JSONObject jsonParam) {
        return fireControlComponentsService.delete(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 消防部件不分页列表
     * @Date Created in 10:24 2021/1/4
     * @Param [jsonParam]项目id
     */

    @At(value = "fireControlComponentsList", method = RequestMethod.GET)
    public RespEntity fireControlComponentsList(@RequestBody(required = false) JSONObject jsonParam) {
        return fireControlComponentsService.fireControlComponentsList(jsonParam);
    }
}
